package com.cy.detectsys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cy.detectsys.entity.ProxynodeResource;
import com.cy.detectsys.service.ProxynodeResourceService;
import com.cy.detectsys.mapper.ProxynodeResourceMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

/**
* @author admin
* @description 针对表【proxynode_resource】的数据库操作Service实现
* @createDate 2024-05-08 01:11:47
*/
@Service
public class ProxynodeResourceServiceImpl extends ServiceImpl<ProxynodeResourceMapper, ProxynodeResource>
    implements ProxynodeResourceService{

    @Override
    public ProxynodeResource getOneProxyNode() {

        PageHelper.startPage(1, 1);
        QueryWrapper<ProxynodeResource> proxynodeResourceQueryWrapper = new QueryWrapper<>();
        proxynodeResourceQueryWrapper.eq("task_proxynode_status_type", 66);
        proxynodeResourceQueryWrapper.last("ORDER BY RAND()");
        ProxynodeResource proxynodeResource = baseMapper.selectOne(proxynodeResourceQueryWrapper);
        return proxynodeResource;
    }
}




